package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.maindata.domain.FinalInspection;
import com.qijian.maindata.domain.query.FinalInspectionQuery;
import com.qijian.maindata.domain.vo.FinalInspectionVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 产品终检Mapper接口
 *
 * @author qijian
 * @date 2022-04-25
 */
public interface FinalInspectionMapper extends BaseMapper<FinalInspection> {

    @Select("select count(0) from main_final_inspection WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    FinalInspectionVo selectVoByIdAndUserId(@Param("id") Long id, @Param("userId") Long userId);

    Page<FinalInspectionVo> selectListVo(Page<FinalInspectionVo> page, @Param(Constants.WRAPPER) QueryWrapper<FinalInspectionQuery> wrapper,
                                         @Param("userId") Long userId);
}
